import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;

public class ParameterUtils {
    private static final DateFormat fm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    private static final String prefix = "\t- ";

    public static void printValueOnStack(boolean value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(byte value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(char value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(short value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(int value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(float value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(long value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(double value) {
        System.out.println(prefix + value);
    }

    public static void printValueOnStack(Object value) {
        if (value == null) {
            System.out.println(prefix);
        } else if (value instanceof String) {
            System.out.println(prefix + value);
        } else if (value instanceof Date) {
            System.out.println(prefix + fm.format(value));
        } else if (value instanceof char[]) {
            System.out.println(prefix + Arrays.toString((char[]) value));
        } else if (value instanceof String[]) {
            System.out.println(prefix + Arrays.toString((String[]) value));
        } else {
            System.out.println(prefix + value.getClass() + ": " + value);
        }
    }

    public static void printText(String str) {
        System.out.println(str);
    }
}
